﻿using ERP.Workflow.Designer.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;

namespace WorkflowEngine.Entitys
{

    public class WorkflowInstance : FullAuditedAggregateRoot<Guid>, IMultiTenant
    {

        [Description("父流成实例Id")]
        public Guid? ParentWorkflowInstanceId { get; set; }

        [Description("流程定义名称")]
        public string WorkflowName { get; set; }

        [Description("流程定义Id")]
        public Guid? DefinitionId { get; set; }

        [Description("创建人所在部门")]
        public Guid CreatorOrgId { get; set; }


        [Description("创建人所在部门Id")]
        public Guid CreatorOrgName { get; set; }


        [Description("完成时间")]
        public DateTime? ComplateTime { get; set; }


        [Description("流程实例状态")]
        public WorkflowInstanceStatus WorkflowInstanceStatus { get; set; }

        [Description("等级")]
        public LevelType LevelType { get; set; }=LevelType.Normal;



        [Description("创建人")]
        public string CreatorCnUserName { get; set; }

        public Guid? TenantId { get; set; }
        public void SetTenantId(Guid tenantId) => TenantId = tenantId;


      

        [Description("步骤实例信息")]
        public virtual List<ActivityInstance> ActivityInstances { get; set; }
        [Description("任务实例信息")]
        public List< ActivityTaskInstance> ActivityTaskInstances { get; set; }


        public string RefObjName { get; set; }
        public string RefObjId { get; set; }
        public string RefObjGroup { get; set; }




    }









}